package com.test.pudamoney.activity_fragment_pudamoney;

import android.os.Bundle;

import com.test.pudamoney.util_pudamoney.StringUtil_pudamoney;
import com.test.pudamoney.util_pudamoney.http_pudamoney.HttpManager_pudamoney;
import com.test.pudamoney.R;
import com.test.pudamoney.activity_fragment_pudamoney.base_pudamoney.BaseActivity_pudamoney;
import com.test.pudamoney.activity_fragment_pudamoney.base_pudamoney.BaseApplication_pudamoney;
import com.test.pudamoney.activity_fragment_pudamoney.login_pudamoney.LoginPhoneNumActivity_pudamoney;
import com.test.pudamoney.util_pudamoney.analytics_pudamoney.util_pudamoney.AnalyticsUtil_pudamoney;

public class MainActivity_pudamoney extends BaseActivity_pudamoney {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main_pudamoney);
        init();
    }

    private void init() {
//        try {
//            //firebase info
//            FirebaseHelper.getInstance().initGa4EventInfo();
//        } catch (Exception e) {
//            e.printStackTrace();
//        }

        findViewById(R.id.activity_main_layout_login).setOnClickListener(v -> HttpManager_pudamoney.getInstance().getAppShowInfo());

        StringUtil_pudamoney.parseAddress(this);
    }

    @Override
    protected void onResume() {
        super.onResume();
        //获取AppShowInfo配置
        HttpManager_pudamoney.getInstance().getAppShowInfo();
    }

    //查询AppShowInfo配置信息响应
    public void onAppShowInfoResponse() {
        //每次启动，等全局配置接口返回成功后，初始化分析模块
        try {
            AnalyticsUtil_pudamoney.INSTANCE.init(BaseApplication_pudamoney.getApplication_pudamoney());
        } catch (Exception e) {
            e.printStackTrace();
        }

        //跳转登录页
        startActivityForSingleTop_pudamoney(LoginPhoneNumActivity_pudamoney.class);
    }
}